package top.itaso.lib.common;

/**
 * @Description: 正则表达式判断条件
 * @Author itsdf07
 * @E-Mail 923255742@qq.com
 * @Gitee https://gitee.com/itsdf07
 * @Date 2024/6/6
 */
public class RegexUtils {
    public static boolean isEmail(String email) {
        String regex = "^[a-zA-Z0-9 -]+@[a-zA-z0-9 -]+(\\.[a-zA-Z0-9 -]+)+$";
        return email.matches(regex);
    }

    public static boolean isPhone(String phone) {
        String regex = "^1[0-9]{10}$";
        return phone.matches(regex);
    }
}
